package wangjg.android.game;

public class Sprite extends Layer {

	int numberFrames; // = 0;

	int[] frameCoordsX;

	int[] frameCoordsY;

	int srcFrameWidth;

	int srcFrameHeight;

	int[] frameSequence;

	private int sequenceIndex; // = 0

	public Sprite() {
	}

	public void setFrame(int sequenceIndex) {
		if (sequenceIndex < 0 || sequenceIndex >= frameSequence.length) {
			throw new IndexOutOfBoundsException();
		}
		this.sequenceIndex = sequenceIndex;
	}

	public final int getFrame() {
		return sequenceIndex;
	}

	public int getRawFrameCount() {
		return numberFrames;
	}

	public int getFrameSequenceLength() {
		return frameSequence.length;
	}

	public void nextFrame() {
		sequenceIndex = (sequenceIndex + 1) % frameSequence.length;
	}

	public void prevFrame() {
		if (sequenceIndex == 0) {
			sequenceIndex = frameSequence.length - 1;
		} else {
			sequenceIndex--;
		}
	}

	public final void paint() {

	}

}
